package com.hehe.Repository;
import com.hehe.POJO.Orders;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;

public interface OrdersRepository extends JpaRepository<Orders, Long> {

    Orders findByUsernameAndPhotoId(String username, int photo_id);


//    @Modifying
//    @Transactional
//    @Query("UPDATE Photo p SET p.collect = p.collect + :add_mins  WHERE p.id = :photoId")
//    int incrementCollectCount(Integer add_mins, long photoId);  // +1  or  -1
//
//
//    //    模糊查询
//    @Query("SELECT p FROM Photo p WHERE p.title LIKE %:title%")
//    Page<Photo> findByTitleContaining(String title, Pageable pageable);


}
